<?php

/**
 * specialite actions.
 *
 * @package    app_clinique
 * @subpackage specialite
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class specialiteActions extends sfActions
{
  /**
   * Executes index action
   *to('Cardiologie','spécialite/cardiologie'); ?></div>
                    <div><?php echo link_to('Pédiatrie','spécialite/pediatrie'); ?></div>
                    <div><?php echo link_to('Chirurgie','spécialite/chirurgie'); ?></div>
                    <div><?php echo link_to('Réanimation','spécialite/activite'); ?></div>
                    <div><?php echo link_to('Ophtalmologie','spécialite/activite'); ?></div>
                    <div><?php echo link_to('Orthopédie','spécialite/activite'); ?></div>
                    <div><?php echo link_to('Radiologie','spécialite/activite'); ?></div>
                    <div><?php echo link_to('Vasculaire','spécialite/activite'); ?></div>
                    <div><?php echo link_to('Urgences','spécialite/activite');
  */
 
  public function executeGenerale()
  {
	   $c = new Criteria();
	   $c->add(sfActualitePeer::GROUP_ID,2);
	   $c->addDescendingOrderByColumn(sfActualitePeer::ID);
	   $this->liste_actualite = sfActualitePeer::doSelect($c);
	   
	   $specialite = 2;
	   //Récupération des pratriciens
	   $e = new Criteria();
	   $e->addSelectColumn(sfGuardGroupPeer::NAME);
	   $e->addSelectColumn(sfGuardUserProfilePeer::NOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::PRENOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::EMAIL);
	   $e->addSelectColumn(sfGuardUserProfilePeer::N_TEL);
	   
	   $e->addJoin(sfGuardUserProfilePeer::USER_ID, sfGuardUserGroupPeer::USER_ID);
	   $e->addJoin(sfGuardUserGroupPeer::GROUP_ID, sfGuardGroupPeer::ID);
	   $e->add(sfGuardUserGroupPeer::GROUP_ID, $specialite);
	   $liste_praticiens = sfGuardUserProfilePeer::doSelectRS($e);
	   
	   $this->nb_results = 0;
	   $this->resultats = array();
	   while ($liste_praticiens->next()){
		   $this->resultats[$this->nb_results]['nom']			= $liste_praticiens->getString(2);
		   $this->resultats[$this->nb_results]['prenom']		= $liste_praticiens->getString(3);
		   $this->resultats[$this->nb_results]['email']			= $liste_praticiens->getString(4);
		   $this->resultats[$this->nb_results]['tel']			= $liste_praticiens->getString(5);
		   ++$this->nb_results;
	   }
      
  }

  public function executePediatrie()
  {
	  $c = new Criteria();
	  $c->add(sfActualitePeer::GROUP_ID,4);
	  $c->addDescendingOrderByColumn(sfActualitePeer::ID);
	  $this->liste_actualite = sfActualitePeer::doSelect($c);
	  
	  $specialite = 4;
	   //Récupération des pratriciens
	   $e = new Criteria();
	   $e->addSelectColumn(sfGuardGroupPeer::NAME);
	   $e->addSelectColumn(sfGuardUserProfilePeer::NOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::PRENOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::EMAIL);
	   $e->addSelectColumn(sfGuardUserProfilePeer::N_TEL);
	   
	   $e->addJoin(sfGuardUserProfilePeer::USER_ID, sfGuardUserGroupPeer::USER_ID);
	   $e->addJoin(sfGuardUserGroupPeer::GROUP_ID, sfGuardGroupPeer::ID);
	   $e->add(sfGuardUserGroupPeer::GROUP_ID, $specialite);
	   $liste_praticiens = sfGuardUserProfilePeer::doSelectRS($e);
	   
	   $this->nb_results = 0;
	   $this->resultats = array();
	   while ($liste_praticiens->next()){
		   $this->resultats[$this->nb_results]['nom']			= $liste_praticiens->getString(2);
		   $this->resultats[$this->nb_results]['prenom']		= $liste_praticiens->getString(3);
		   $this->resultats[$this->nb_results]['email']			= $liste_praticiens->getString(4);
		   $this->resultats[$this->nb_results]['tel']			= $liste_praticiens->getString(5);
		   ++$this->nb_results;
	   }
  }

  public function executeCardiologie()
  {
  	$c = new Criteria();
  	$c->add(sfActualitePeer::GROUP_ID,3);
	$c->addDescendingOrderByColumn(sfActualitePeer::ID);
  	$this->liste_actualite = sfActualitePeer::doSelect($c);
	
	$specialite = 3;
	   //Récupération des pratriciens
	   $e = new Criteria();
	   $e->addSelectColumn(sfGuardGroupPeer::NAME);
	   $e->addSelectColumn(sfGuardUserProfilePeer::NOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::PRENOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::EMAIL);
	   $e->addSelectColumn(sfGuardUserProfilePeer::N_TEL);
	   
	   $e->addJoin(sfGuardUserProfilePeer::USER_ID, sfGuardUserGroupPeer::USER_ID);
	   $e->addJoin(sfGuardUserGroupPeer::GROUP_ID, sfGuardGroupPeer::ID);
	   $e->add(sfGuardUserGroupPeer::GROUP_ID, $specialite);
	   $liste_praticiens = sfGuardUserProfilePeer::doSelectRS($e);
	   
	   $this->nb_results = 0;
	   $this->resultats = array();
	   while ($liste_praticiens->next()){
		   $this->resultats[$this->nb_results]['nom']			= $liste_praticiens->getString(2);
		   $this->resultats[$this->nb_results]['prenom']		= $liste_praticiens->getString(3);
		   $this->resultats[$this->nb_results]['email']			= $liste_praticiens->getString(4);
		   $this->resultats[$this->nb_results]['tel']			= $liste_praticiens->getString(5);
		   ++$this->nb_results;
	   }
  }

  public function executeDentaire()
  {
  	  $c = new Criteria();
	  $c->add(sfActualitePeer::GROUP_ID,8);
	  $c->addDescendingOrderByColumn(sfActualitePeer::ID);
	  $this->liste_actualite = sfActualitePeer::doSelect($c);
	  
	  $specialite = 8;
	   //Récupération des pratriciens
	   $e = new Criteria();
	   $e->addSelectColumn(sfGuardGroupPeer::NAME);
	   $e->addSelectColumn(sfGuardUserProfilePeer::NOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::PRENOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::EMAIL);
	   $e->addSelectColumn(sfGuardUserProfilePeer::N_TEL);
	   
	   $e->addJoin(sfGuardUserProfilePeer::USER_ID, sfGuardUserGroupPeer::USER_ID);
	   $e->addJoin(sfGuardUserGroupPeer::GROUP_ID, sfGuardGroupPeer::ID);
	   $e->add(sfGuardUserGroupPeer::GROUP_ID, $specialite);
	   $liste_praticiens = sfGuardUserProfilePeer::doSelectRS($e);
	   
	   $this->nb_results = 0;
	   $this->resultats = array();
	   while ($liste_praticiens->next()){
		   $this->resultats[$this->nb_results]['nom']			= $liste_praticiens->getString(2);
		   $this->resultats[$this->nb_results]['prenom']		= $liste_praticiens->getString(3);
		   $this->resultats[$this->nb_results]['email']			= $liste_praticiens->getString(4);
		   $this->resultats[$this->nb_results]['tel']			= $liste_praticiens->getString(5);
		   ++$this->nb_results;
	   }
  }

  public function executeOphtalmologie()
  {
  	  $c = new Criteria();
	  $c->add(sfActualitePeer::GROUP_ID,5);
	  $c->addDescendingOrderByColumn(sfActualitePeer::ID);
	  $this->liste_actualite = sfActualitePeer::doSelect($c);
	  
	  $specialite = 5;
	   //Récupération des pratriciens
	   $e = new Criteria();
	   $e->addSelectColumn(sfGuardGroupPeer::NAME);
	   $e->addSelectColumn(sfGuardUserProfilePeer::NOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::PRENOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::EMAIL);
	   $e->addSelectColumn(sfGuardUserProfilePeer::N_TEL);
	   
	   $e->addJoin(sfGuardUserProfilePeer::USER_ID, sfGuardUserGroupPeer::USER_ID);
	   $e->addJoin(sfGuardUserGroupPeer::GROUP_ID, sfGuardGroupPeer::ID);
	   $e->add(sfGuardUserGroupPeer::GROUP_ID, $specialite);
	   $liste_praticiens = sfGuardUserProfilePeer::doSelectRS($e);
	   
	   $this->nb_results = 0;
	   $this->resultats = array();
	   while ($liste_praticiens->next()){
		   $this->resultats[$this->nb_results]['nom']			= $liste_praticiens->getString(2);
		   $this->resultats[$this->nb_results]['prenom']		= $liste_praticiens->getString(3);
		   $this->resultats[$this->nb_results]['email']			= $liste_praticiens->getString(4);
		   $this->resultats[$this->nb_results]['tel']			= $liste_praticiens->getString(5);
		   ++$this->nb_results;
	   }
  }

  public function executeRadiologie()
  {
  	  $c = new Criteria();
	  $c->add(sfActualitePeer::GROUP_ID,7);
	  $c->addDescendingOrderByColumn(sfActualitePeer::ID);
	  $this->liste_actualite = sfActualitePeer::doSelect($c);
	  
	  $specialite = 7;
	   //Récupération des pratriciens
	   $e = new Criteria();
	   $e->addSelectColumn(sfGuardGroupPeer::NAME);
	   $e->addSelectColumn(sfGuardUserProfilePeer::NOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::PRENOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::EMAIL);
	   $e->addSelectColumn(sfGuardUserProfilePeer::N_TEL);
	   
	   $e->addJoin(sfGuardUserProfilePeer::USER_ID, sfGuardUserGroupPeer::USER_ID);
	   $e->addJoin(sfGuardUserGroupPeer::GROUP_ID, sfGuardGroupPeer::ID);
	   $e->add(sfGuardUserGroupPeer::GROUP_ID, $specialite);
	   $liste_praticiens = sfGuardUserProfilePeer::doSelectRS($e);
	   
	   $this->nb_results = 0;
	   $this->resultats = array();
	   while ($liste_praticiens->next()){
		   $this->resultats[$this->nb_results]['nom']			= $liste_praticiens->getString(2);
		   $this->resultats[$this->nb_results]['prenom']		= $liste_praticiens->getString(3);
		   $this->resultats[$this->nb_results]['email']			= $liste_praticiens->getString(4);
		   $this->resultats[$this->nb_results]['tel']			= $liste_praticiens->getString(5);
		   ++$this->nb_results;
	   }
  }

  public function executeOrthopedie()
  {
  	  $c = new Criteria();
	  $c->add(sfActualitePeer::GROUP_ID,6);
	  $c->addDescendingOrderByColumn(sfActualitePeer::ID);
	  $this->liste_actualite = sfActualitePeer::doSelect($c);
	  
	  $specialite = 6;
	   //Récupération des pratriciens
	   $e = new Criteria();
	   $e->addSelectColumn(sfGuardGroupPeer::NAME);
	   $e->addSelectColumn(sfGuardUserProfilePeer::NOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::PRENOM);
	   $e->addSelectColumn(sfGuardUserProfilePeer::EMAIL);
	   $e->addSelectColumn(sfGuardUserProfilePeer::N_TEL);
	   
	   $e->addJoin(sfGuardUserProfilePeer::USER_ID, sfGuardUserGroupPeer::USER_ID);
	   $e->addJoin(sfGuardUserGroupPeer::GROUP_ID, sfGuardGroupPeer::ID);
	   $e->add(sfGuardUserGroupPeer::GROUP_ID, $specialite);
	   $liste_praticiens = sfGuardUserProfilePeer::doSelectRS($e);
	   
	   $this->nb_results = 0;
	   $this->resultats = array();
	   while ($liste_praticiens->next()){
		   $this->resultats[$this->nb_results]['nom']			= $liste_praticiens->getString(2);
		   $this->resultats[$this->nb_results]['prenom']		= $liste_praticiens->getString(3);
		   $this->resultats[$this->nb_results]['email']			= $liste_praticiens->getString(4);
		   $this->resultats[$this->nb_results]['tel']			= $liste_praticiens->getString(5);
		   ++$this->nb_results;
	   }
  }

}
